package top.dark.ware.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import top.dark.common.utils.R;

/**
 * Author: Darkn
 * description:
 * Create Time: 2021/2/25 15:17
 */
@FeignClient("mall-product")
public interface ProductFeignService {

    /**
     * 两种方式实现：
     *  1、走网关，然后转发请求到product服务
     *      @FeignClient("mall-gateway")
     *      @RequestMapping("/api/product/skuinfo/info/{skuId}")
     *  2、直接通过发送请求访问product服务
     *      @FeignClient("mall-product")
     *      @RequestMapping("/product/skuinfo/info/{skuId}")
     */
    @RequestMapping("/product/skuinfo/info/{skuId}")
    R info(@PathVariable("skuId") Long skuId);

}
